package com.pronhub.cloud.shop.server.impl;

import com.pronhub.cloud.shop.domain.Good;
import com.pronhub.cloud.shop.server.IGoodService;
import com.pronhub.cloud.shop.mapper.GoodMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;
@Service
public class GoodServiceImpl implements IGoodService {
    @Autowired
    private GoodMapper goodMapper;
    @Override
    public List<Good> queryByIds(List<Long> ids) {
        if(ids==null || ids.size()==0){
            //没有传参数过来，没必要去查询数据库，直接返回空集合
            return Collections.EMPTY_LIST;
        }
        return goodMapper.queryByIds(ids);
    }
}
